package com.example;
public class Test7 {
    // 1判断数组中是否包含某个元素  并且返回调用处

    public static void main(String[] args) {
        int [] arr = {1,2,3,4,5};
        boolean flag = contains(arr, 3);
        System.out.println(flag);
    }

    public static boolean contains(int[]arr ,int number) {
        for (int i = 0; i < arr.length; i++) {
            if(arr[i] == number){
                return true;
            }
        }
        return false;
    }
}